<?php
if ( $is_print ) {
	header('Content-type: application/vnd.ms-excel');
	header('Content-Disposition: attachment; filename=' . $po_info['po_number'] .'.xls');
}
?>

<table style="{{ $text_calibri }} {{ $text_size_12 }}">
<img border=0 height="100px" src="{{ URL::asset('assets/image/logos/logo-acommerce-small.png') }}" />
<tr><td rowspan="4" colspan="7" style="{{ $text_center }} {{ $text_size_11 }} ">&nbsp;</td></tr>
<tr><td colspan="7" style="{{ $text_center }} {{ $text_size_11 }} ">&nbsp;</td></tr>
<tr><td colspan="7" style="{{ $text_center }} {{ $text_size_11 }} ">&nbsp;</td></tr>
<tr><td colspan="7" style="{{ $text_center }} {{ $text_size_11 }} ">&nbsp;</td></tr>

<tr><td colspan="7" style="{{ $text_center }} {{ $text_size_11 }} ">{{ Lang::get('info.ACOMMERCE.building') }}</td></tr>
<tr><td colspan="7" style="{{ $text_center }} {{ $text_size_11 }} ">{{ Lang::get('info.ACOMMERCE.street') }}</td></tr>
<tr><td colspan="7" style="{{ $text_center }} {{ $text_size_11 }} ">{{ Lang::get('info.ACOMMERCE.city') }} {{ Lang::get('info.ACOMMERCE.postal') }}</td></tr>
<tr><td colspan="7" style="{{ $text_center }} {{ $text_size_20 }} {{ $text_bold }}">{{ $print_po_title }}</td></tr>
<tr><td colspan="7">&nbsp;</td></tr>

<!-- Purchase Order Main Details -->
<tr>
	<td colspan="1" style="{{ $text_bold }} ">{{ $print_merchant_name }}:</td>
	<td colspan="6" style="{{ $border_bottom }} {{ $padding_left_10 }}">{{ $vendor->name }}</td>
</tr>
<tr>
	<td colspan="1" style="{{ $text_bold }} ">{{ $print_client_po_date }}:</td>
	<td colspan="6" style="{{ $border_bottom }} {{ $padding_left_10 }}">{{ $po_info['po_date'] }}</td>
</tr>
<tr>
	<td colspan="1" style="{{ $text_bold }} ">{{ $print_po_number_or_name }}*:</td>
	<td colspan="6" style="{{ $border_bottom }} {{ $padding_left_10 }}">{{ $po_info['po_number'] }}</td>
</tr>
<tr>
	<td colspan="1" style="{{ $text_bold }} ">{{ $print_delivery_due_date }}*:</td>
	<td colspan="6" style="{{ $border_bottom }} {{ $padding_left_10 }}">{{ $po_info['delivery_date'] }}</td>
</tr>
<tr rowspan="2"><td colspan="7">&nbsp;</td></tr>

<!-- Purchase Order Products Title -->
<tr style="{{ $text_center }}">
	<td style="{{ $text_bold }} {{ $padding_5 }} {{ $black_and_white }}">{{ $print_product_name }}</td>
	<td style="{{ $text_bold }} {{ $padding_5 }} {{ $black_and_white }}">{{ $print_sku }}</td>
	<td width="180px" style="{{ $text_bold }} {{ $padding_5 }} {{ $black_and_white }}">{{ $print_storage }}*</td>
	<td width="50px" style="{{ $text_bold }} {{ $padding_5 }} {{ $black_and_white }}">{{ $print_qc }}*</td>
	<td width="50px" style="{{ $text_bold }} {{ $padding_5 }} {{ $black_and_white }}">{{ $print_po_qty }}*</td>
	<td width="50px" style="{{ $text_bold }} {{ $padding_5 }} {{ $black_and_white }}">{{ $print_received_qty }}</td>
	<td width="100px" style="{{ $text_bold }} {{ $padding_5 }} {{ $black_and_white }}">{{ $print_remarks }}</td>
</tr>

<!-- Purchase Order Products -->
@foreach( $products as $item ) 
<tr style="{{ $text_size_11 }}">
	<td style="{{ $border }}">
		{{ $item['name'] }}
		@if ( !empty( $item['options'] ) )
			<br/>
			@foreach( $item['options'] as $option )
				{{ $option['value'] }} - {{ $option['quantity'] }},
			@endforeach
		@endif
	</td>
	<td style="{{ $border }} {{ $text_middle }}">{{ $item['sku'] }}</td>
	<td style="{{ $border }} {{ $text_middle }}"></td>
	<td style="{{ $border }} {{ $text_middle }}"></td>
	<td style="{{ $border }} {{ $text_middle }} {{ $text_right }} {{ $padding_right_5 }}">{{ $item['quantity'] }}</td>
	<td style="{{ $border }} {{ $text_middle }} {{ $text_right }} {{ $padding_right_5 }}"></td>
	<td style="{{ $border }} {{ $text_middle }}"></td>
</tr>
@endforeach
<tr rowspan="2"><td colspan="7" style="{{ $border }}">&nbsp;</td></tr>

<!-- Total Rows -->
<tr>
	<td colspan="4" style="{{ $black_and_white }} {{ $text_right }} {{ $padding_right_5 }}">{{ $print_total }}</td>
	<td style="{{ $border }} {{ $text_right }} {{ $padding_right_5 }}">{{ $po_info['total_quantity'] }}</td>
	<td style="{{ $border }}"></td>
	<td style="{{ $border }}"></td>
</tr>

<tr><td colspan="7">&nbsp;</td></tr>
<tr>
	<td style="{{ $text_size_10 }} {{ $text_bold }} {{ $text_top }}">{{ $print_qc_title }}:</td>
	<td colspan="2" style="{{ $text_size_10 }} {{ $text_top }}">{{ $print_qc_description }}</td>
	<td style="{{ $text_size_10 }} {{ $text_bold }} {{ $text_right }} {{ $text_top }}">{{ $print_storage_title }}:</td>
	<td colspan="3" style="{{ $text_size_10 }} {{ $text_top }}">{{ $print_storage_description }}</td>
</tr>
<tr><td colspan="7">&nbsp;</td></tr>

<!-- Signees Rows -->
<tr>
	<td>{{ $print_prepared_by }}:</td> <td colspan="3">{{ $po_info['prepared_by'] }}</td> <td></td> <td></td>
</tr>
<tr><td colspan="7">&nbsp;</td></tr>
<tr>
	<td>{{ $print_delivered_by }}:</td> <td colspan="4"></td> <td></td> <td></td>
</tr>
<tr>
	<td></td> <td colspan="4" style="{{ $text_center }} {{ $text_size_10 }} {{ $border_top }}">({{ $print_signature }})</td> <td></td> <td></td>
</tr>
<tr>
	<td>{{ $print_received_by }}:</td> <td colspan="4" style="{{ $text_gray }} {{ $text_italic }} {{ $text_center }}">({{ $print_acommerce_personnel }})</td> <td></td> <td></td>
</tr>
<tr>
	<td></td> <td colspan="4" style="{{ $text_center }} {{ $text_size_10 }} {{ $border_top }}">({{ $print_signature }})</td> <td></td> <td></td>
</tr>
<tr>
	<td>{{ $print_date }}:</td> <td colspan="4" style="{{ $text_gray }} {{ $text_italic }} {{ $text_center }}"></td> <td></td> <td></td>
</tr>
<tr>
	<td></td> <td colspan="4" style="{{ $text_center }} {{ $text_size_10 }} {{ $border_top }}">({{ $print_date_format }})</td> <td></td> <td></td>
</tr>

</table>